from main.model.devices.memory.physical.ram import RAM
from main.model.devices.memory.continuous.continuous_memory import ContinuousMemory

class VirtualMemory(object):

    def __init__(self, manager=None, size=1000):
        self.__manager = manager or ContinuousMemory(RAM(size))

    def load(self, program, pcb):
        return self.manager.load(program, pcb)

    def get(self, address, pcb):
        return self.manager.get(address, pcb)
    
    def unlink(self, pcb):
        return self.manager.unlink(pcb)

    @property
    def manager(self):
        return self.__manager
